# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>

_php=php7
pkgname=mongo-${_php}-library
_realname=mongo-php-library
pkgver=1.4.2
pkgrel=0
pkgdesc="High-level abstraction around the lower-level drivers for PHP"
url="https://github.com/mongodb/mongo-php-library"
arch="noarch"
license="Apache-2.0"
makedepends="$depends_dev ${_php}-mongodb"
subpackages="$pkgname-doc"
options="!check" # require mongodb server
source="$_realname-$pkgver.tar.gz::https://github.com/mongodb/$_realname/archive/$pkgver.tar.gz"
builddir="$srcdir"/$_realname-$pkgver

build() {
	cd "$builddir"
	return 0
}

package() {
	cd "$builddir"
	mkdir -p "$pkgdir"/usr/share/doc/mongo-${_php}-library/docs
	mkdir -p "$pkgdir"/usr/lib/${_php}/vendor/mongodb/mongodb
	mv src/* "$pkgdir"/usr/lib/${_php}/vendor/mongodb/mongodb
	mv tests "$pkgdir"/usr/lib/${_php}/vendor/mongodb/mongodb/
	mv docs/* "$pkgdir"/usr/share/doc/mongo-${_php}-library/docs
	mv LICENSE README.md "$pkgdir"/usr/share/doc/mongo-${_php}-library
}

sha512sums="c473b85f60fd942f591c712187d68744b95472f11450af5bcd1768d79fb0e3ffe08c486fad72898fe5fd3002e865ea79959767b80830db92bd92d87f52877f33  mongo-php-library-1.4.2.tar.gz"
